Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show testcontainers using oci image as fixture #222

Closed
wants to merge 1 commit into from

Conversation

alexeagle
Copy link
Member

I had a request from a client today to see an example like this. I suspect it will be widely useful to see an e2e test that can coordinate our java, python, and java OCI containers we build in this repo.


Type of change

  • Documentation (updates to documentation or READMEs)

Test plan

bazel test ...

import sys
import pytest

if __name__ == "__main__":
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note, this is what the aspect_rules_py py_pytest_main creates. That repo isn't on registry.bazel.build yet, so I just vendored the file content here.

Copy link
Member

@thesayyn thesayyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

# https://github.com/testcontainers/testcontainers-python/blob/2bcb931063e84da1364aa26937778f0e45708000/core/testcontainers/core/container.py#L107-L108
port = container.get_exposed_port(8080)

# TODO(alexeagle): have the application inside the container listen on a port so we can use it as a test fixture
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thesayyn I'm not sure it's worth landing this until we can actually communicate with a python process running in the container.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could make it a separate example here? and use testcontainers instead of structure_test for testing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could imagine a separate "integration testing" example that wants to tie together the other stuff in this repo - we'd have our first cross-workspace dependencies though.

I'm getting close to writing a blog post about it, is why I'm working in here at all.

Copy link
Contributor

@f0rmiga f0rmiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right place for this. This is python using Docker, nothing to do with rules_oci.

@alexeagle
Copy link
Member Author

@f0rmiga This is what clients asked for. If they build an image in their monorepo, how do they use it in an integration test fixture? They want to see them together.

@f0rmiga
Copy link
Contributor

f0rmiga commented May 11, 2023

I understand this is desirable, but in the same way that you removed Gazelle from this example, I don't think we should do integration. I can see this being an example on its own.

@f0rmiga
Copy link
Contributor

f0rmiga commented May 11, 2023

I can be convinced of the contrary...

@alexeagle
Copy link
Member Author

No I agree as each example gains features it gets harder to navigate and understand each bit in isolation

@alexeagle
Copy link
Member Author

I'll put this in #223 instead, it's going to be a big one

@alexeagle alexeagle closed this May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants